package com.bp.hearthealth.pulse.lnapps.bp_ui.bp_fragment.bp_lifestyle

import com.bp.hearthealth.pulse.lnapps.R
import com.bp.hearthealth.pulse.lnapps.bp_extension.UIHelperBp
import com.bp.hearthealth.pulse.lnapps.bp_network.BaseRepository
import com.bp.hearthealth.pulse.lnapps.bp_network.bp_api.ApiBpService
import com.bp.hearthealth.pulse.lnapps.bp_ui.bp_fragment.bp_lifestyle.bp_bean.BpLifeStyleBean
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.withContext

class BpLifeStyleRepository(private val service: ApiBpService) : BaseRepository() {

    suspend fun loadBloodPerssure() = withContext(Dispatchers.IO) {
        coroutineScope {
            val list = mutableListOf<BpLifeStyleBean>()
            list.add(
                BpLifeStyleBean(
                    UIHelperBp.getString(R.string._blood_pressure_tips_a_str),
                    UIHelperBp.getColor(R.color.color_FDD32E),
                    R.mipmap.bp_1
                )
            )
            list.add(
                BpLifeStyleBean(
                    UIHelperBp.getString(R.string._blood_pressure_tips_b_str),
                    UIHelperBp.getColor(R.color.color_FA763F),
                    R.mipmap.bp_2
                )
            )
            list.add(
                BpLifeStyleBean(
                    UIHelperBp.getString(R.string._blood_pressure_tips_c_str),
                    UIHelperBp.getColor(R.color.color_04B2B8),
                    R.mipmap.bp_3
                )
            )
            list.add(
                BpLifeStyleBean(
                    UIHelperBp.getString(R.string._blood_pressure_tips_d_str),
                    UIHelperBp.getColor(R.color.color_6A35FF),
                    R.mipmap.bp_4
                )
            )
            list.add(
                BpLifeStyleBean(
                    UIHelperBp.getString(R.string._blood_pressure_tips_e_str),
                    UIHelperBp.getColor(R.color.color_FDD32E),
                    R.mipmap.bp_5
                )
            )
            list.add(
                BpLifeStyleBean(
                    UIHelperBp.getString(R.string._blood_pressure_tips_f_str),
                    UIHelperBp.getColor(R.color.color_FA763F),
                    R.mipmap.bp_6
                )
            )
            list
        }
    }

    suspend fun loadBloodSugar() = withContext(Dispatchers.IO) {
        coroutineScope {
            val list = mutableListOf<BpLifeStyleBean>()
            list.add(
                BpLifeStyleBean(
                    UIHelperBp.getString(R.string._blood_sugar_tips_a_str),
                    UIHelperBp.getColor(R.color.color_FDD32E),
                    R.mipmap.bs_1
                )
            )
            list.add(
                BpLifeStyleBean(
                    UIHelperBp.getString(R.string._blood_sugar_tips_b_str),
                    UIHelperBp.getColor(R.color.color_FA763F),
                    R.mipmap.bs_2
                )
            )
            list.add(
                BpLifeStyleBean(
                    UIHelperBp.getString(R.string._blood_sugar_tips_c_str),
                    UIHelperBp.getColor(R.color.color_04B2B8),
                    R.mipmap.bs_3
                )
            )
            list.add(
                BpLifeStyleBean(
                    UIHelperBp.getString(R.string._blood_sugar_tips_d_str),
                    UIHelperBp.getColor(R.color.color_6A35FF),
                    R.mipmap.bs_4
                )
            )
            list.add(
                BpLifeStyleBean(
                    UIHelperBp.getString(R.string._blood_sugar_tips_e_str),
                    UIHelperBp.getColor(R.color.color_FDD32E),
                    R.mipmap.bs_5
                )
            )
            list.add(
                BpLifeStyleBean(
                    UIHelperBp.getString(R.string._blood_sugar_tips_f_str),
                    UIHelperBp.getColor(R.color.color_FA763F),
                    R.mipmap.bs_6
                )
            )
            list
        }
    }

    suspend fun loadHealthyDiet() = withContext(Dispatchers.IO) {
        coroutineScope {
            val list = mutableListOf<BpLifeStyleBean>()
            list.add(
                BpLifeStyleBean(
                    UIHelperBp.getString(R.string._healthy_diet_tips_1_str),
                    UIHelperBp.getColor(R.color.color_FDD32E),
                    R.mipmap.hd_1
                )
            )
            list.add(
                BpLifeStyleBean(
                    UIHelperBp.getString(R.string._healthy_diet_tips_2_str),
                    UIHelperBp.getColor(R.color.color_FA763F),
                    R.mipmap.hd_2
                )
            )
            list.add(
                BpLifeStyleBean(
                    UIHelperBp.getString(R.string._healthy_diet_tips_3_str),
                    UIHelperBp.getColor(R.color.color_04B2B8),
                    R.mipmap.hd_3
                )
            )
            list.add(
                BpLifeStyleBean(
                    UIHelperBp.getString(R.string._healthy_diet_tips_4_str),
                    UIHelperBp.getColor(R.color.color_6A35FF),
                    R.mipmap.hd_4
                )
            )
            list.add(
                BpLifeStyleBean(
                    UIHelperBp.getString(R.string._healthy_diet_tips_5_str),
                    UIHelperBp.getColor(R.color.color_FDD32E),
                    R.mipmap.hd_5
                )
            )
            list.add(
                BpLifeStyleBean(
                    UIHelperBp.getString(R.string._healthy_diet_tips_6_str),
                    UIHelperBp.getColor(R.color.color_FA763F),
                    R.mipmap.hd_6
                )
            )
            list
        }
    }
}